import { Get, Inject, Provide } from '@midwayjs/decorator';
import { CoolController, BaseController } from '@cool-midway/core';
import { BusinessUserEntity } from '../../entity/user';
import { BusinessUserService } from '../../service/user';


/**
 * 用户
 */
@Provide()
@CoolController({
  api: ['info'],
  entity: BusinessUserEntity,
  service: BusinessUserService,
})
export class BusinessAppUserController extends BaseController {
  @Inject()
  businessUserService: BusinessUserService;
  /**
   * 获取当前登录用户信息
   */
  @Get('/userinfo', { summary: '获取当前登录用户信息' })
  async userinfo() {
    const result = await this.businessUserService.getUserinfoByClient()
    return this.ok(result);
  }
}
